import socket

server = socket.socket()

server.bind(("localhost", 8888))

server.listen(100)

conn, address = server.accept()

# conn = result[0] # 连接对象
# address = result[1] # 客户端地址信息

print(f"接收到客户端连接：{address}")

byte_buf = conn.recv(1024)
recv = byte_buf.decode("UTF-8")
print(f"接收到客户端的消息：{recv}")

message = input(f"请输入你要回复的信息：")
conn.send(message.encode(encoding="UTF-8"))

conn.close()

server.close()
